home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3661 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  49 lines

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: floating point dynamic array
  5. Date: 30 Jan 1996 08:14 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <30JAN199608140261@erich.triumf.ca>
  9. References: <310EFD40.2D03@se.cuhk.hk>
  10. NNTP-Posting-Host: erich.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <310EFD40.2D03@se.cuhk.hk>, Lawrence Xiao <hkshiou3@se.cuhk.hk> writes...
  14. >Hi all,
  15. >I try to use dynamic array to store series of floating point.  
  16. >But error message returns.  However, there won't be any problem 
  17. >when I change the all the declaration from floating point 
  18. >to integer.
  19. >The message I get is:
  20. >"scanf: floating point formats not linked"
  21. >"abnormal program termination"
  22. You are probably using a Borland compiler.  This results from a well-known (and
  23. documented) feature to save a couple of K of code.  If the linker doesn't see
  24. any float operations, it doesn't link the support code that scanf() needs. 
  25. Simply reading floats with scanf(), and storing them  is not sufficient to make
  26. the linker link the required code.
  27.  
  28. A readme file that came with the compiler should have some info on this,
  29. including a suggestion to add the lines:
  30.     extern _floatconvert;
  31.     #pragma extref _floatconvert;
  32. or similar (don't have the info handy...)
  33.  
  34. Or add a dummy float operation - call sin(), or other math function.
  35.  
  36. This problem shouldn't occur in a Real program that does some calculations on
  37. the flaots it reads in.
  38.  
  39.  
  40. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  41. Internet: bennett@triumf.ca         | of one another only when one can be
  42. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  43. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  44. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  45.  
  46.